#ifndef HTTPCLIENT_H
#define HTTPCLIENT_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QProcess>
#include <QTimer>

class HttpClient:public QObject
{
    Q_OBJECT
public:
    HttpClient();
    bool downLoadFileByUrl(QString strUrl,int size,int type);
    void initData();
    void createAction();
	bool getFileFromServer(QString strStuNum);
	bool requestFromServer(QString strStuNum,QString& strErrorMsg);
	bool requestTopicFromServer(QString strStuNum, int paperNumn,QString& strErrorMsg);
	bool updateScoreToServer(QString strStuNum, int paperNumn, QString& strErrorMsg);
	bool requestPractice(QString strStuNum,QString strDeskCode, int paperNumn, QString& strErrorMsg);
	bool requestPracticeResult(QString strStuNum, QString strDeskCode, int paperNumn, QString& strErrorMsg);
	
	public slots:
	void slotReceiveMsgFromOtherProcess(int orderType, QList<QByteArray> msgList);

signals:
	void signalSendMsgToOtherProcess(int orderType, QList<QByteArray> msgList);

    private:
    /*QNetworkAccessManager* m_networkManager;
    QNetworkReply* m_reply;*/
    QString m_fileName;
    QUrl m_url;

    QProcess* m_wget_process;
};

#endif // HTTPCLIENT_H
